package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityPicMapper;
import com.ruoyi.system.domain.ActivityPic;
import com.ruoyi.system.service.IActivityPicService;
import com.ruoyi.common.core.text.Convert;

/**
 * 活动图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class ActivityPicServiceImpl implements IActivityPicService 
{
    @Autowired
    private ActivityPicMapper activityPicMapper;

    /**
     * 查询活动图片
     * 
     * @param id 活动图片主键
     * @return 活动图片
     */
    @Override
    public ActivityPic selectActivityPicById(String id)
    {
        return activityPicMapper.selectActivityPicById(id);
    }

    /**
     * 查询活动图片列表
     * 
     * @param activityPic 活动图片
     * @return 活动图片
     */
    @Override
    public List<ActivityPic> selectActivityPicList(ActivityPic activityPic)
    {
        return activityPicMapper.selectActivityPicList(activityPic);
    }

    /**
     * 新增活动图片
     * 
     * @param activityPic 活动图片
     * @return 结果
     */
    @Override
    public int insertActivityPic(ActivityPic activityPic)
    {
        activityPic.setCreateTime(DateUtils.getNowDate());
        return activityPicMapper.insertActivityPic(activityPic);
    }

    /**
     * 修改活动图片
     * 
     * @param activityPic 活动图片
     * @return 结果
     */
    @Override
    public int updateActivityPic(ActivityPic activityPic)
    {
        activityPic.setUpdateTime(DateUtils.getNowDate());
        return activityPicMapper.updateActivityPic(activityPic);
    }

    /**
     * 批量删除活动图片
     * 
     * @param ids 需要删除的活动图片主键
     * @return 结果
     */
    @Override
    public int deleteActivityPicByIds(String ids)
    {
        return activityPicMapper.deleteActivityPicByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动图片信息
     * 
     * @param id 活动图片主键
     * @return 结果
     */
    @Override
    public int deleteActivityPicById(String id)
    {
        return activityPicMapper.deleteActivityPicById(id);
    }
}
